package com.masterclient.app.businessmodule.vipmodule.activity;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.widget.FrameLayout;
import android.widget.TextView;
import com.arjinmc.recyclerviewdecoration.RecyclerViewItemDecoration;
import com.eoner.baselib.widget.navgation.FCNavigationBar;
import com.masterclient.app.R;
import com.masterclient.app.base.FCBusinessActivity;
import com.masterclient.app.businessmodule.vipmodule.adapter.LogisticsAdapter;
import com.masterclient.app.businessmodule.vipmodule.bean.Logistics;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 物流信息
 */
public class LogisticsActivity extends FCBusinessActivity {

    @BindView(R.id.danhao_tv)
    TextView danhaoTv;
    @BindView(R.id.copy_view)
    FrameLayout copyView;
    @BindView(R.id.from_tv)
    TextView fromTv;
    @BindView(R.id.to_tv)
    TextView toTv;
    @BindView(R.id.status_tv)
    TextView statusTv;
    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;
    private LogisticsAdapter adapter;

    @Override
    protected int requireGetLayoutId() {
        return R.layout.activity_logsitics;
    }

    @Override
    protected void requireSetCustomNavigationBar(FCNavigationBar navigationBar) {
        navigationBar.setTitle("物流信息");
    }

    @Override
    protected void requireInitUIAndData(Bundle savedInstanceState) {
        adapter = new LogisticsAdapter();
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        recyclerView.addItemDecoration(new RecyclerViewItemDecoration.Builder(this)
                .thickness(0).color(Color.TRANSPARENT)
                .create());
        recyclerView.setAdapter(adapter);
        List<Logistics> logisticsList = new ArrayList<>();
        Logistics logistics = new Logistics(2);
        logistics.setContent("【广州市】白云区耀龙康城小区正在为你安排投递派送员：徐杰，电话：13000001234");
        logisticsList.add(logistics);

        logistics = new Logistics(1);
        logistics.setContent("到达：广州白云区物流中心集散点");
        logisticsList.add(logistics);

        logistics = new Logistics(0);
        logistics.setContent("发往：广州白云区物流中心集散点");
        logisticsList.add(logistics);

        logistics = new Logistics(0);
        logistics.setContent("扫描：广州白云区物流中心集散点");
        logisticsList.add(logistics);

        adapter.addData(logisticsList);
    }

    @OnClick(R.id.copy_view)
    public void onViewClicked() {
    }
}
